1. Field of the Invention
The present invention relates, generally, to systems and methods for transferring data across different data buses, and in particular embodiments, to methods for transferring data formatted for a Peripheral Component Interconnect (PCI) data bus across a non-PCI data bus, and systems incorporating the same.
2. Description of Related Art
Modern processor-based systems often use standardized bus architectures for transferring data. For example, ASB is a bus standard developed by Advanced RISC Machines (ARM) for use with their ARM9 series of processors. ASB is typically used in low power applications such as system-on-a-chip applications. PCI is an industry standard input/output (I/O) bus specification typically used in higher-power applications such as connecting peripherals to a personal computer (PC) or workstation.
It is often useful to design processor-based systems that utilize both of these bus standards. For example, in the design of set-top boxes, an ARM processor may be used in conjunction with an ASB bus to transfer data from a peripheral to memory. However, greater connectivity may be achieved if one of the peripherals is a PCI interface. With a PCI as one of the peripherals, the set-top box can be connected to PCI-compatible peripherals such as a modem, an Ethernet controller, or some other digital data source.
FIG. 1 is a block diagram of an example set-top box system 10 utilizing both ASB and PCI buses. As illustrated in FIG. 1, within a primary integrated circuit (IC) 12xe2x80x94in essence a system on a chipxe2x80x94is an ARM processor 14 coupled to an ASB. The ASB is comprised of a data bus BD 16 and an address bus BA 18. Also within the IC 12 and coupled to the ASB is a PCI I/O interface 20 and a memory controller 22. The PCI I/O interface 20 may be connected off-chip to other peripherals such as modems 24, Ethernet controllers 26, storage subsystems 28, graphics cards 30, or other external devices through a PCI address/data (A/D) bus 32, which can function as both an address and data bus. The Ethernet controller 26 or modem 24 might be used for connecting to the Internet to provide the set-top box system 10 with web surfing capability.
In addition, video data may be transferred through the PCI I/O interface 20 to a video card 34 such that, rather than being a component of a set-top box system 10, the IC 12 could reside on a plug-in card for executing Motion Picture Experts Group (MPEG) audio/video decompression, with the PCI I/O interface 20 sending video data to video cards 34 in a PC system to display the images on-screen.
The memory controller 22 is coupled to off-chip synchronous dynamic random access memory (SDRAM) 36 for storing information transferred over the ASB bus.
The IC 12 may have dedicated ports for connecting to a satellite front end 38 to receive high-speed video and audio data 42. In such a configuration, a data parser 40 receives the audio and video data 42 from the satellite front end 38, parses out all the data packets, decides which data packets are to be stored, and then sends those data packets to the memory controller 22 for storing in the SDRAM 36. However, it is also possible for data received through the satellite front end 38 to enter the set-top box system 10 through the Ethernet controller 26 and PCI I/O interface 20.
An audio/video block 44 within the IC 12 retrieves data from the SDRAM 36, decompresses the data, outputs the audio data 46, and communicates the video data to a display refresh module 48. The display refresh module 48 then sends the video data 50 to an off-chip encoder 52, which converts the digital video data into NTSC or PAL format for transmission to a video display device 54.
An ASB system will now be described as an example of a non-PCI system. As noted above, the ASB is designed to operate in conjunction with the ARM processor 14, which transfers 32 bits of data (one word) at a time. However, not all of the data bits in the word may be valid. The ARM processor 14 is capable of transferring one word of valid data, 16-bits (a half-word) of valid data, or 8-bits (one byte) of valid data in contiguous memory locations. FIG. 2 is an illustration of the seven possible xe2x80x9cbyte patternsxe2x80x9d that may be present when 32 bits of data (four bytes, denoted bytes 0-3) appear on BD 16, the shaded blocks representing valid bytes. One possible pattern is a word transfer 56, where all four bytes are valid. Another possible pattern is a half-word transfer of bytes 0-1 (reference character 58) or bytes 2-3 (reference character 60). The other possible transfer patterns are byte transfers 62, where the valid byte can be any one of the four bytes. Note that the ARM bus can only transfer data in the patterns illustrated in FIG. 2xe2x80x94for example, a half-word transfer can have either bytes 0-1 or bytes 2-3 valid, but it cannot have bytes 1 and 2 or bytes 0 and 3 valid.
Devices mastering the ASB must generate certain signals to describe which bytes in the transfer are valid. As illustrated in FIG. 2, one is a two-bit control signal called BSIZE, whose encodings are as follows: binary 00 means a byte transfer, binary 01 means a half-word transfer and binary 10 means a word transfer. Another signal is the two least significant bits of the address bus, BA[1:0]. BA[1:0] identifies, given a particular BSIZE, which of the four bytes in the 32-bit word being transferred are valid. It should be noted that in ASB format the address and data buses BA 18 and BD 16 are not shared because it is more efficient to have separate address and data buses, and because ASB is typically used within a chip where minimizing the number of pins is relatively unimportant.
As illustrated in FIG. 2, a BSIZE of binary 10 and a BA[1:0] of XX (X indicating don""t cares) signifies that all bytes in the word being transferred are valid. For a BSIZE of binary 01, BA[1:0] can be either 0, signifying that bytes 0-1 (one half-word) are valid, or 1, signifying that bytes 2-3 (the other half-word) are valid. For a BSIZE of binary 00, BA[1:0] can be 00, signifying that byte 0 is valid, 01, signifying that byte 1 is valid, 10, signifying that byte 2 is valid, or 11, signifying that byte 3 is valid. The memory controller 22 decodes BSIZE and BA[1:0] to determine which bytes on BD are valid and should be transferred to memory.
For purposes of illustration, FIG. 3 is a timing diagram of a half-word write transfer in a conventional ASB system. Referring to FIG. 3, BWRITE is a control signal generated by the device mastering the bus that indicates whether the operation is a read or a write. In the example of FIG. 3, a high state indicates a write operation, while a low state indicates a read operation. BSIZE, as described above, is a two-bit control signal also generated by the device mastering the bus that indicates whether the valid data being transferred is a byte, half-word, or word transfer. BA, as described above, is the 32-bit address bus. BTRAN is a 2-bit control signal, driven only during the first half of a clock cycle, that determines what kind of a transfer is on the bus. In the example of FIG. 3, binary 00 indicates no transfer (the bus is idle), a binary 11 indicates a sequential transfer, and a binary 10 indicates a non-sequential transfer. It should be noted that the ARM processor 14 does not use non-sequential transfers, which simplifies the decoding of BTRAN. BWAIT is a control signal, driven by the slave device (the memory controller 22 in FIG. 1) in response to signals from the master only during the second half of a clock cycle, that indicates whether the slave device is ready to respond or not. In the example of FIG. 3, a high state indicates that the slave device is not ready, while a low state indicates that the slave device is ready. BD, as described above, is the 32-bit data bus.
The vertical lines in FIG. 3 represent clock cycles, identified as T0-T4. During T0, when nothing is happening, BTRAN is driven to binary 00, and the slave device responds by driving BWAIT to a default low state. During T1, to initiate a half-word write transfer of bytes 2 and 3 the master drives BWRITE high, and BSIZE is driven from a high impedance (tri-state) to binary 01. BA is also driven from a high impedance to the desired address (say 3002 in this example), and four bytes of data are driven onto BD (say bytes 3-0=ABCD in this example).
During T2, BTRAN is driven to a binary 11, indicating a sequential transfer, and the slave device responds by driving BWAIT high to indicate that a wait state is needed while the slave device determines how to respond to the data transfer. During T3 the slave device responds by driving BWAIT low, indicating that the receiving device is ready to accept the transfer. During T4, for a single write (a non-burst transaction) the master drives BTRAN to binary 00, indicating an address-only transfer on the end of the current transaction. During T4, BD becomes valid and is sampled at reference character 64, and the transaction completes. Of course, because BSIZE was binary 01 and BA[1:0]=binary 10, only bytes A and B were valid and actually transferred.
A PCI bus system will now be described. As noted above, PCI allows peripheral devices to be coupled to the system through a PCI I/O interface 20. PCI provides the ability to do bus mastering, which means the peripherals themselves can initiate transfers. Because peripherals are typically external devices, minimizing the number of pins is important, so addresses and data share the same bus, the PCI A/D bus 32. The PCI A/D bus 32 is designed to operate in conjunction with peripherals capable of transferring 32-bit words (four bytes). As in ASB, not all of the data bits in the word may be valid. Unlike BD 16 in ASB, however, the PCI A/D bus 32 is capable of transferring valid data in any of 16 possible byte patterns.
One reason for the added flexibility of PCI is that unlike the ARM processor 14, which is designed for transfers of contiguous blocks of data, peripherals connected to the PCI A/D bus 32 may want to transfer data in mapped byte patterns. For example, a display adapter may want to update system memory (the SDRAM 36) only every fourth byte, every other byte or other interval, or in some mapped pattern. To accommodate mapped write patterns and generally enable a higher throughput on the data bus, PCI allows bursting. If the PCI A/D bus 32 is viewed as carrying a sequence of xe2x80x9cdataxe2x80x9d as illustrated in FIG. 4, then in burst mode an address A at the beginning of the xe2x80x9cdataxe2x80x9d sequence may be followed by contiguous words of data D0-D7, each word being 32 bits. The eight contiguous data words D0-D7 are illustrated in the expanded view of FIG. 5 as 32 contiguous bytes of data. The shaded bytes in FIG. 5 denote valid data bytes transferred by the master peripheral according to an example mapped pattern.
FIG. 6 is an illustration of the 16 possible byte patterns that may be present when four bytes (denoted bytes 0-3) appear on the PCI A/D bus 32 at any time. Peripherals mastering the PCI A/D bus 32 must generate a byte enable (BE) for each 32-bit word transferred to identify which bytes in the transfer are valid. The BE is 4-bit control signal generated concurrently with the 32-bit word being transferred and denoted BE[3:0], each bit corresponding to one of the four bytes of data being transferred. Where a byte enable bit is low, the corresponding data byte is valid. Thus, for example, if BE[3:0]=binary 1010, bytes 2 and 0 are valid. FIG. 6 illustrates the 16 possible states of BE[3:0] and their corresponding byte patterns of valid data bytes.
For purposes of illustration, FIG. 7 is a timing diagram of a half-word write transfer in a conventional PCI system. For purposes of comparison, the same data will be written to the same address as the example of FIG. 3. Referring to FIG. 7, PCI C/BE is a shared PCI command/byte enable signal and PCI A/D bus is the shared PCI A/D bus 32 described above. PCI C/BE contains a command when the PCI A/D bus contains an address, but PCI C/BE contains BE (described above) when the PCI A/D bus contains data. Both PCI C/BE and the PCI A/D bus are generated by the device mastering the bus. In addition, the master also generates FRAME and IRDY. FRAME is asserted when a data transfer is occurring. In response to IRDY, the slave device generates TRDY, and DEVSEL. TRDY indicates that the slave device is ready to actually transfer data. DEVSEL indicates that the slave device has accepted responsibility for completing the transaction.
The vertical lines in FIG. 7 represent clock cycles, identified as T0-T4. During T1, the transfer begins when the device mastering the bus drives FRAME low, drives an address (3000 in this example) onto the PCI A/D bus, and drives PCI C/BE to a binary 0111. It should be noted that in the ASB example of FIG. 3, the address bus BA contained 3002, while in this PCI example, the PCI A/D bus contains 3000. The reason for the difference is that in ASB, the two least significant bits of BA (BA[1:0]) determine which bytes are valid, and hence the xe2x80x9c2xe2x80x9d in xe2x80x9c3002xe2x80x9d is required. In contrast, for PCI the BE determines which bytes are valid, and hence only xe2x80x9c3000xe2x80x9d is required. In addition, the master drives PCI C/BE to a binary 0111 indicating that a write transfer is to be performed.
During T2, the master drives FRAME (11.12) high and IRDY low, indicating that data ABCD is now available on the PCI A/D bus. A byte enable of 0011 is also driven onto PCI C/BE, indicating that only bytes A and B are valid.
During T3, TRDY and DEVSEL are driven low by the slave device when the receiving device has been determined and is ready to accept the transfer. When TRDY and DEVSEL are low, bytes 3:0 of the PCI A/D bus are sampled during T3, and the transaction completes. However, because the byte enable on PCI C/BE was binary 0011, only bytes A and B were valid and actually transferred.
While ASB and PCI are both capable of transferring data in a variety of byte patterns, a comparison of FIG. 6 and FIG. 2 reveals that there are 16 possible valid byte patterns in PCI, but only seven in ASB. Thus, there are nine byte patterns in PCI that would not be recognized by ASB. Despite this inherent incompatibility, the data representations allowed by PCI must also be supported by the ASB interface to properly transfer all data received by the PCI I/O interface 20. Of course, these incompatibilities are not limited to ASB and PCI. It may be desirable to transfer PCI-compatible data across other bus standards that are incompatible with PCI.
A PCI-compliant bridge is therefore needed to resolve the data incompatibilities between PCI and non-PCI systems to allow the non-PCI system to recognize and transfer byte patterns other than those it natively supports. In the case of ASB, for example, such a bridge would allow the ASB to transfer byte patterns other than the seven patterns it natively supports. Several solutions are currently known in the art for effecting such a bridge. One possibility would be to break a PCI data transfer into multiple transfers, each recognizable by the non-PCI system. In the case of ASB, for example, PCI byte patterns not supported by ASB such as the one identified by reference character 66 in FIG. 6 could be mapped to two separate transactions on the ASB, where a half-word transfer (see reference character 60 in FIG. 2) would be followed by a byte transfer (see reference character 68 in FIG. 2). However, such a method may become extremely inefficient for lengthy streams of ASB-incompatible byte patterns. Referring to FIG. 5 for purposes of illustration, it might take 10 or more independent transactions to get eight words of data across to the memory controller 22 if the word transfers were split into individual transfers. The added delays would create a huge bottleneck in the PCI I/O interface 20.
Another solution known in the art is to connect the PCI I/O interface 20 directly to the memory controller 22 through an independent data and address bus. In such solutions, the PCI I/O interface 20 would have two distinct interfacesxe2x80x94one for transfers to the PCI-incompatible device such as the ARM 14, and one for transfers to the memory controller 22. In addition, the memory controller 22 would have two distinct interfaces, one for the PCI-incompatible device, and one for the PCI I/O interface 20. These additional interfaces add physical complexity and create more arbitration within the memory controller 22.
Therefore, it is an advantage of embodiments of the present invention to provide a system and method for resolving data incompatibilities between PCI and non-PCI systems that avoids the data bottlenecks that occur when PCI byte patterns are decomposed into multiple data transfers recognizable by the non-PCI system.
It is a further advantage of embodiments of the present invention to provide a system and method for resolving data incompatibilities between PCI and non-PCI systems that avoids the need for an independent address and data bus for PCI and the non-PCI system and the additional physical complexity and arbitration that accompanies such dual buses.
These and other objects are accomplished according to a system for transferring PCI data over a non-PCI bus. The non-PCI bus includes an address bus and a data bus for communicating addresses and data. A PCI-compatible peripheral is coupled to the non-PCI bus for transmitting and receiving PCI-compatible data. A non-PCI device is also coupled to the non-PCI bus for transmitting and receiving data. In addition, a slave device is also coupled to the non-PCI bus for receiving and transmitting PCI data and non-PCI data.
A control line capable of being driven by the PCI-compatible peripheral and the non-PCI device is coupled between the PCI-compatible peripheral, the non-PCI device, and the slave device for indicating whether data appearing on the data bus is from the PCI-compatible peripheral or the non-PCI device, and for indicating how many bytes on the data bus are actually valid, if the data appearing on the data bus is from the non-PCI device. A bus byte enable (BBE) driven by the PCI-compatible peripheral is also coupled between the PCI-compatible peripheral and the slave device for indicating which bytes on the data bus are valid.
The slave device decodes the control line, the BBE, and the address bus to accept valid bytes of PCI data and non-PCI data appearing on the data bus.
These and other objects, features, and advantages of embodiments of the invention will be apparent to those skilled in the art from the following detailed description of embodiments of the invention, when read with the drawings and appended claims.